package database;


import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectData {

    public static Connection connect() {
        String url = "jdbc:mysql://localhost:3306/DB?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC";


        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }


        Connection con = null ;

        try {
            con = DriverManager.getConnection(url, "root", "2333");
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
        return con;
    }
}

